<template>
  <div class="brand">
    <div class="title">
      <h3>专题精选</h3>
    </div>
    <van-swipe :loop="false" :width="350" :show-indicators="false">
      <van-swipe-item v-for="item in topicList" :key="item.id">
        <img :src="item.item_pic_url" width="100%" />
        <div class="item-des">
          <h4>{{item.title}}</h4>&emsp;
          <span>{{item.price_info | priceFilter}}</span>
          <p>{{item.subtitle}}</p>
        </div>
      </van-swipe-item>
    </van-swipe>
  </div>
</template>

<script>
export default {
  props: {
    topicList: Array
  },
};
</script>

<style lang="less" scoped>
.brand {
  border-top: 10px solid #f4f4f4;
  padding-left: 10px;
  .title {
    text-align: center;
    h3 {
      font-weight: normal;
    }
  }
  .van-swipe {
    .van-swipe__track {
      display: flex;
      /deep/.van-swipe-item {
        width: 80%;
      }
    }
    img {
      width: 97%;
      height: 200px;
      font-size: 0;
    }
    .item-des {
      h4 {
        margin: 0;
        font-weight: normal;
        display: inline-block;
      }
      span {
        color: darkred;
      }
      p {
        line-height: 30px;
        color: #666;
        font-size: 12px;
        width: 100%;
        text-overflow: ellipsis;
        white-space: nowrap;
        overflow: hidden;
        margin: 0;
      }
    }
  }
}
</style>